package cola0502.project.hellospringbootcola0502.controller;

import cola0502.project.hellospringbootcola0502.entity.Account;
import cola0502.project.hellospringbootcola0502.service.AccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
@RequestMapping("/v1/api/accounts")
public class AccountController {

    @Resource
    AccountService accountService;

    @PostMapping("insertAccount")
    public Account insertAccount(Account account){
        Account save_Account = accountService.insertAccount(account);
        return save_Account;
    }

    @PostMapping("sayHello")
    public String sayHello(){
        return "Hello I am Account";
    }
}
